{% extends 'flatpages/default.html' %}

{% block content %}
    <h1 class="text-center"> Поиск</h1>
    <h3>{{ time_now }}</h3>
    <h3> {{ value1|default_if_none:"ничего" }} </h3>
    <br>
    <br>
    <form action="#" method="get">
        {{ q.form }}
        <input type="submit" value="Найти">
    </form>
    <br>
    <br>
    {% for post in q.qs %}
        {{post.publ}}
        <br>
        <h2 class="fw-bolder"><a href="{% url 'newsPort:detail' post.id%}">{{ post.title }}</a></h2>
        <br>
        <h3 class="fw-bold">Тема: {{ post.categories }}</h3>
        <br>
        <p class="fw-normal">{{ post.text|truncatewords:50 }}</p>
        <h4 class="fw-bold">{{ post.author }}</h4> 
        <br>
    {% endfor %}
{% endblock content %}